package hivi.vn.hivigold.objects;

import hivi.vn.hivigold.fragment.ReportFragment;

import org.json.JSONException;
import org.json.JSONObject;

public class Report {
	private String nhom_hang;
	private String ma_hang;
	private String ten_hang;
	private String dvt;
	private String code;
	private Double sl_ban;
	private Double gia_ban;
	private Double tien_ban;
	private Double gia_von;
	private Double tien_von;
	private Double lai;
	
	private Double sl_mua;
	private Double gia_mua;
	private Double tien_mua;
	
	private Double sl_td;
	private Double au_td;
	private Double du_dau;
	private Double sl_nhap;
	private Double au_nhap;
	private Double tien_nhap;
	private Double sl_xuat;
	private Double au_xuat;
	private Double tien_xuat;
	private Double sl_tc;
	private Double au_tc;
	private Double du_cuoi;
	
	public Double getSl_td() {
		return sl_td;
	}
	public void setSl_td(Double sl_td) {
		this.sl_td = sl_td;
	}
	public Double getAu_td() {
		return au_td;
	}
	public void setAu_td(Double au_td) {
		this.au_td = au_td;
	}
	public Double getDu_dau() {
		return du_dau;
	}
	public void setDu_dau(Double du_dau) {
		this.du_dau = du_dau;
	}
	public Double getSl_nhap() {
		return sl_nhap;
	}
	public void setSl_nhap(Double sl_nhap) {
		this.sl_nhap = sl_nhap;
	}
	public Double getAu_nhap() {
		return au_nhap;
	}
	public void setAu_nhap(Double au_nhap) {
		this.au_nhap = au_nhap;
	}
	public Double getTien_nhap() {
		return tien_nhap;
	}
	public void setTien_nhap(Double du_nhap) {
		this.tien_nhap = du_nhap;
	}
	public Double getSl_xuat() {
		return sl_xuat;
	}
	public void setSl_xuat(Double sl_xuat) {
		this.sl_xuat = sl_xuat;
	}
	public Double getAu_xuat() {
		return au_xuat;
	}
	public void setAu_xuat(Double au_xuat) {
		this.au_xuat = au_xuat;
	}
	public Double getTien_xuat() {
		return tien_xuat;
	}
	public void setTien_xuat(Double du_xuat) {
		this.tien_xuat = du_xuat;
	}
	public Double getSl_tc() {
		return sl_tc;
	}
	public void setSl_tc(Double sl_tc) {
		this.sl_tc = sl_tc;
	}
	public Double getAu_tc() {
		return au_tc;
	}
	public void setAu_tc(Double au_tc) {
		this.au_tc = au_tc;
	}
	public Double getDu_cuoi() {
		return du_cuoi;
	}
	public void setDu_cuoi(Double du_cuoi) {
		this.du_cuoi = du_cuoi;
	}
	public Double getSl_mua() {
		return sl_mua;
	}
	public void setSl_mua(Double sl_mua) {
		this.sl_mua = sl_mua;
	}
	public Double getGia_mua() {
		return gia_mua;
	}
	public void setGia_mua(Double gia_mua) {
		this.gia_mua = gia_mua;
	}
	public Double getTien_mua() {
		return tien_mua;
	}
	public void setTien_mua(Double tien_mua) {
		this.tien_mua = tien_mua;
	}
	public Report() {
		// TODO Auto-generated constructor stub
	}
	public Report(int report_key, JSONObject json)
	{
		try {
			if(report_key == ReportFragment.REPORT_BAN)
			{
				nhom_hang = json.getString("Nhom_hang");
				ma_hang = json.getString("Ma_hang");
				ten_hang = json.getString("Ten_hang");
				dvt = json.getString("Dvt");
				code = json.getString("Code");
				sl_ban = json.getDouble("Sl_ban");
				gia_ban = json.getDouble("Gia_ban");
				tien_ban = json.getDouble("Tien_ban");
				gia_von = json.getDouble("Gia_von");
				tien_von = json.getDouble("Tien_von");
				lai = json.getDouble("Lai");
			}if(report_key == ReportFragment.REPORT_MUA)
			{
				nhom_hang = json.getString("Nhom_hang");
				ma_hang = json.getString("Ma_hang");
				ten_hang = json.getString("Ten_hang");
				dvt = json.getString("Dvt");
				code = json.getString("Code");
				sl_mua = json.getDouble("So_luong");
				gia_mua = json.getDouble("Gia");
				tien_mua = json.getDouble("Tien");
			}if(report_key == ReportFragment.REPORT_NXT)
			{
				nhom_hang = json.getString("Nh_vt");
				ma_hang = json.getString("Ma_vt");
				ten_hang = json.getString("Ten_vt");
				dvt = json.getString("Dvt");
				code = json.getString("Code");
				gia_von = json.getDouble("Gia_von");
				du_dau = json.getDouble("Du_dau");
				sl_td = json.getDouble("sl_ton_dau");
				au_td = json.getDouble("Tlg_au_td");
				sl_nhap = json.getDouble("sl_nhap");
				au_nhap = json.getDouble("Tlg_au_nhap");
				tien_nhap = json.getDouble("Tien_nhap");
				sl_xuat = json.getDouble("sl_xuat");
				au_xuat = json.getDouble("Tlg_au_xuat");
				tien_xuat = json.getDouble("Tien_xuat");
				sl_tc = json.getDouble("sl_ton_cuoi");
				au_tc = json.getDouble("Tlg_au_tc");
				du_cuoi = json.getDouble("Du_cuoi");
			}
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public String getNhom_hang() {
		return nhom_hang;
	}
	public void setNhom_hang(String nhom_hang) {
		this.nhom_hang = nhom_hang;
	}
	public String getMa_hang() {
		return ma_hang;
	}
	public void setMa_hang(String ma_hang) {
		this.ma_hang = ma_hang;
	}
	public String getTen_hang() {
		return ten_hang;
	}
	public void setTen_hang(String ten_hang) {
		this.ten_hang = ten_hang;
	}
	public String getDvt() {
		return dvt;
	}
	public void setDvt(String dvt) {
		this.dvt = dvt;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Double getSl_ban() {
		return sl_ban;
	}
	public void setSl_ban(Double sl_ban) {
		this.sl_ban = sl_ban;
	}
	public Double getGia_ban() {
		return gia_ban;
	}
	public void setGia_ban(Double gia_ban) {
		this.gia_ban = gia_ban;
	}
	public Double getTien_ban() {
		return tien_ban;
	}
	public void setTien_ban(Double tien_ban) {
		this.tien_ban = tien_ban;
	}
	public Double getGia_von() {
		return gia_von;
	}
	public void setGia_von(Double gia_von) {
		this.gia_von = gia_von;
	}
	public Double getTien_von() {
		return tien_von;
	}
	public void setTien_von(Double tien_von) {
		this.tien_von = tien_von;
	}
	public Double getLai() {
		return lai;
	}
	public void setLai(Double lai) {
		this.lai = lai;
	}
	
	
}
